Conversation
At install time the list of upstream profiles to disable is not available, but the disable/ symlinks shipped by the package are. Use them as source and move the upstream profile aside as <name>.<pkgname>, like the prebuild Overwrite task does.
SetFlags now takes a list of flags files or *.conf dirs, read in order, so aa-install can feed it the user config dirs. Flag rewriting moves to util.ApplyFlags and profiles moved aside by overwrite are resolved as <profile>.<pkgname>.
Inverse of Ignore: keep only the profiles and groups listed in the *.conf files of the user config dirs, everything else is removed. When any include rule is set, this task takes over profile selection from Install.
Only keep profiles whose attachment resolves to a program present on the system. Attachments are read from the built profile header, AppArmor variables are substituted to filesystem globs, and profiles with no attachment follow their group. Disable symlinks are reconciled with the profiles actually kept.
The groups/ tree is flattened by the Merge task, so group membership is saved in the shared task config for the later tasks that need it.
Set a default enforce/complain mode on every profile at install time, except the profiles a user flags.d drop-in already assigns a mode to.
…graph.
A paragraph starting with `}` continues the conditional block of the
previous one, its matching `{` is there, so the tokenizer would see
unbalanced braces. Merge them instead.
Install, update and remove the apparmor.d profiles from the source tree to /etc/apparmor.d. Profile selection, flags and deploy mode come from the vendor and admin config dirs, and an installed-file manifest is kept so status, list and uninstall know exactly what was written.
debian/apparmor.d.hide is now a static file in the package, so there is no need to write it from prebuild.
Add pkg/state to detect the system state and manage the state tunable files.
The overwrite list is now shipped as an overwrite.d config file. The disable link and the <name>.<pkgname> rename are only applied when the target ships the upstream profile, in all install modes. Also drop config-package-dev: the diverted profiles stayed in /etc/apparmor.d and were still read by the parser.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR split the unified
apparmor.dpackage into three packages:apparmor.d-tools: for apparmor.d tools such asaa-log, and the new toolaa-installapparmor.d-base: for abstractions, and tunables. Installed in/etc/apparmor.d/apparmor.d: for all prebuilt profiles, installed in/usr/share/apparmor.d/(it could have been/usr/lib/apparmor.d, however, future upstream profiles may use this location, and I do not want to conflict with them).Upon installation of
apparmor.d, and after each install of a new program, a trigger/hook (re)install the profiles.aa-installinstall and manage the AppArmor profiles shipped by apparmor.d. Profiles are built from/usr/share/apparmor.d/, filtered and flagged according to the configuration, then deployed to the AppArmor policy directory and apparmor is reloaded.Installed profiles are recorded in a manifest so that later runs can report the installation status, list the deployed profiles, or uninstall them.
Configuration files:
Configuration directories:
Mode keys:
See man aa-install(1) for more information.
See #986